<template>
  <div class="app-container home">
    <!-- 顶部横幅 - 融合书法文化元素 -->
    <div class="banner-section">
      <div class="banner-content">
        <div class="banner-text">
          <h1 class="banner-title">鲁园文化管理系统</h1>
          <p class="banner-subtitle">传承千年书法文化 · 弘扬翰墨丹青之美</p>
          <!-- <div class="banner-stats">
            <div class="stat-item">
              <i class="el-icon-user"></i>
              <span class="stat-number">1,234</span>
              <span class="stat-label">用户数</span>
            </div>
            <div class="stat-item">
              <i class="el-icon-document"></i>
              <span class="stat-number">568</span>
              <span class="stat-label">作品数</span>
            </div>
            <div class="stat-item">
              <i class="el-icon-star-on"></i>
              <span class="stat-number">2,456</span>
              <span class="stat-label">访问量</span>
            </div>
          </div> -->
        </div>
        <div class="banner-decoration">
          <div class="calligraphy-stroke"></div>
        </div>
      </div>
    </div>

    <el-row :gutter="20" style="margin-top: 20px;">
      <!-- 系统概览 -->
      <el-col :sm="24" :md="8">
        <el-card class="home-card overview-card">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-data-line"></i> 系统概览</span>
          </div>
          <div class="overview-content">
            <div class="overview-item">
              <div class="item-icon bg-primary">
                <i class="el-icon-user"></i>
              </div>
              <div class="item-info">
                <div class="item-value">1,234</div>
                <div class="item-label">用户总数</div>
              </div>
            </div>
            <div class="overview-item">
              <div class="item-icon bg-success">
                <i class="el-icon-picture-outline"></i>
              </div>
              <div class="item-info">
                <div class="item-value">568</div>
                <div class="item-label">作品总数</div>
              </div>
            </div>
            <div class="overview-item">
              <div class="item-icon bg-warning">
                <i class="el-icon-star-off"></i>
              </div>
              <div class="item-info">
                <div class="item-value">2,456</div>
                <div class="item-label">点赞总数</div>
              </div>
            </div>
          </div>
        </el-card>
      </el-col>

      <!-- 快捷操作 - 带书法风格图标 -->
      <el-col :sm="24" :md="8">
        <el-card class="home-card quick-actions-card">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-lightning"></i> 快捷操作</span>
          </div>
          <div class="quick-actions">
            <el-row :gutter="15">
              <el-col :span="12" v-for="action in quickActions" :key="action.title">
                <div class="action-item" @click="handleAction(action)">
                  <div class="action-icon" :class="action.color">
                    <i :class="action.icon"></i>
                  </div>
                  <span class="action-title">{{ action.title }}</span>
                </div>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </el-col>

      <!-- 文化展示 -->
      <el-col :sm="24" :md="8">
        <el-card class="home-card culture-card">
          <div slot="header" class="clearfix">
            <span><i class="el-icon-trophy"></i> 书法文化</span>
          </div>
          <div class="culture-content">
            <div class="culture-item">
              <h4>书法五体</h4>
              <p>篆、隶、楷、行、草，各具特色，承载千年文化传承。</p>
            </div>
            <div class="culture-item">
              <h4>文房四宝</h4>
              <p>笔、墨、纸、砚，是书法创作不可或缺的工具。</p>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.9.0",
      // 快捷操作
      quickActions: [
        { title: "用户管理", icon: "el-icon-user", color: "primary", path: "/system/user" },
        { title: "角色管理", icon: "el-icon-lock", color: "success", path: "/system/role" },
        { title: "菜单管理", icon: "el-icon-menu", color: "warning", path: "/system/menu" },
        { title: "作品管理", icon: "el-icon-picture-outline", color: "danger", path: "/gallery/works" }
      ],
      // 更新日志
      updateLogs: [
        { version: "v3.9.0", date: "2025-05-28", description: "优化菜单搜索查询页，导航栏显示昵称&设置" },
        { version: "v3.8.9", date: "2024-12-30", description: "用户管理支持分栏拖动，修改主题样式本地读取" },
        { version: "v3.8.8", date: "2024-06-30", description: "菜单管理新增路由名称，新增数据脱敏过滤注解" },
        { version: "v3.8.7", date: "2023-12-08", description: "操作日志记录部门名称，全局数据存储用户编号" }
      ]
    }
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank")
    },
    handleAction(action) {
      this.$message.info(`即将跳转到${action.title}`)
      // 这里可以添加实际的路由跳转逻辑
      // this.$router.push(action.path)
    }
  }
}
</script>

<style scoped lang="scss">
.home {
  background-color: #f0f2f5;
  padding: 20px;

  // 统一卡片样式
  .home-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    
    ::v-deep .el-card__body {
      flex: 1;
      display: flex;
      flex-direction: column;
    }
  }

  // 顶部横幅 - 融合书法文化元素
  .banner-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 30px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    
    &::before {
      content: "";
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: 
        radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%),
        linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255,255,255,0.05) 75%, transparent 75%),
        linear-gradient(-45deg, rgba(255,255,255,0.05) 75%, transparent 75%);
      background-size: 20px 20px;
      transform: rotate(30deg);
    }
    
    .banner-content {
      position: relative;
      z-index: 1;
      display: flex;
      justify-content: space-between;
      align-items: center;
      
      .banner-text {
        flex: 1;
        
        .banner-title {
          font-size: 2.2rem;
          font-weight: 700;
          margin-bottom: 10px;
          text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
          font-family: "Microsoft YaHei", "STHeiti", sans-serif;
        }
        
        .banner-subtitle {
          font-size: 1.1rem;
          margin-bottom: 30px;
          opacity: 0.9;
          font-family: "Microsoft YaHei", "STHeiti", sans-serif;
        }
        
        .banner-stats {
          display: flex;
          
          .stat-item {
            margin-right: 30px;
            
            i {
              font-size: 24px;
              display: block;
              margin-bottom: 10px;
            }
            
            .stat-number {
              display: block;
              font-size: 1.5rem;
              font-weight: bold;
              margin-bottom: 5px;
            }
            
            .stat-label {
              font-size: 0.9rem;
              opacity: 0.8;
            }
          }
        }
      }
      
      .banner-decoration {
        .calligraphy-stroke {
          width: 150px;
          height: 100px;
          background: url('../assets/images/profile.jpg') no-repeat center;
          background-size: contain;
          opacity: 0.8;
        }
      }
    }
  }

  .el-card {
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    
    ::v-deep .el-card__header {
      font-weight: bold;
      font-size: 16px;
      background-color: #fafafa;
      border-bottom: 1px solid #ebeef5;
      
      i {
        margin-right: 8px;
        color: #409EFF;
      }
    }
  }

  // 系统概览卡片
  .overview-card {
    .overview-content {
      .overview-item {
        display: flex;
        align-items: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
        
        &:last-child {
          border-bottom: none;
        }
        
        .item-icon {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 15px;
          
          i {
            font-size: 24px;
            color: white;
          }
          
          &.bg-primary {
            background: linear-gradient(135deg, #409EFF, #66b1ff);
          }
          
          &.bg-success {
            background: linear-gradient(135deg, #67C23A, #85ce61);
          }
          
          &.bg-warning {
            background: linear-gradient(135deg, #E6A23C, #ebb563);
          }
        }
        
        .item-info {
          .item-value {
            font-size: 24px;
            font-weight: bold;
            color: #303133;
            margin-bottom: 5px;
          }
          
          .item-label {
            font-size: 14px;
            color: #909399;
          }
        }
      }
    }
    height: 50vh;
  }

  // 快捷操作卡片
  .quick-actions-card {
    .quick-actions {
      .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px 10px;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.3s;
        border: 1px solid #ebeef5;
        margin-bottom: 10px;
        
        &:hover {
          background-color: #ecf5ff;
          border-color: #409EFF;
          transform: translateY(-2px);
          box-shadow: 0 2px 12px 0 rgba(64, 158, 255, 0.2);
        }
        
        .action-icon {
          width: 40px;
          height: 40px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-bottom: 10px;
          
          i {
            font-size: 20px;
            color: white;
          }
          
          &.primary {
            background: linear-gradient(135deg, #409EFF, #66b1ff);
          }
          
          &.success {
            background: linear-gradient(135deg, #67C23A, #85ce61);
          }
          
          &.warning {
            background: linear-gradient(135deg, #E6A23C, #ebb563);
          }
          
          &.danger {
            background: linear-gradient(135deg, #F56C6C, #f78989);
          }
        }
        
        .action-title {
          font-size: 14px;
          color: #606266;
        }
      }
    }
    height: 50vh;
  }

  // 文化展示卡片
  .culture-card {
    .culture-content {
      .culture-item {
        padding: 15px 0;
        border-bottom: 1px solid #eee;
        
        &:last-child {
          border-bottom: none;
        }
        
        h4 {
          margin: 0 0 10px 0;
          color: #303133;
          font-size: 16px;
        }
        
        p {
          margin: 0;
          color: #606266;
          font-size: 14px;
          line-height: 1.5;
        }
      }
    }
    height: 50vh;
  }
}

@media (max-width: 992px) {
  .home {
    .banner-section {
      .banner-content {
        flex-direction: column;
        
        .banner-text {
          margin-bottom: 20px;
          
          .banner-stats {
            .stat-item {
              margin-right: 20px;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 768px) {
  .home {
    padding: 10px;
    
    .el-card {
      margin-bottom: 15px;
    }
    
    .banner-section {
      padding: 20px;
      
      .banner-content {
        .banner-text {
          .banner-title {
            font-size: 1.8rem;
          }
          
          .banner-subtitle {
            font-size: 1rem;
          }
          
          .banner-stats {
            .stat-item {
              margin-right: 15px;
              
              i {
                font-size: 20px;
              }
              
              .stat-number {
                font-size: 1.2rem;
              }
            }
          }
        }
        
        .banner-decoration {
          .calligraphy-stroke {
            width: 100px;
            height: 70px;
          }
        }
      }
    }
  }
}
</style>